#ifndef DETECT_H
#define DETECT_H

#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
#include <tracking/src/networkfunc.h>

#include "PedestrianBox.h"

enum DET_TYPE{
 YOLOV5=0,
};

//class NetworkDetect{
//public:
//   NetworkDetect(){};
//   ~NetworkDetect() {};
//   virtual int init(const std::string& weight_path){};
//   virtual int detect(const std::vector<cv::Mat>& imgs, std::vector<std::vector<cv::Rect2f>>& dets, int predict_h, int predict_w)=0;
//
//protected:
//   void *handle;
//};

class ObjectDetect : public NetworkDetect {
public:
    
    ObjectDetect(int device_id, DET_TYPE model_type, uint8_t dataType, bool use_dynamic=false, bool alway_serialize=false):
    device_id(device_id), model_type(model_type), dataType(dataType), use_dynamic(use_dynamic), alway_serialize(alway_serialize){
        handle=nullptr;
    };
    virtual int init(const std::string& weight_path);
    ~ObjectDetect();
    virtual int detect(const std::vector<cv::Mat>& imgs, std::vector<std::vector<Detection>>& dets, int predict_h, int predict_w);
private:
    int device_id;
    DET_TYPE model_type;
    bool use_dynamic, alway_serialize;
    uint8_t dataType;
};

#endif //EXTRACTOR_H
